package com.markyao.controller;

import com.markyao.service.AuthService;
import com.markyao.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
public class AuthController {
    @Autowired
    AuthService authService;
    @GetMapping("auth")
    public Result auth( @RequestParam("username")String username, @RequestParam("password")String password){
        return authService.auth(username,password);
    }
    @GetMapping("auth0")
    public Result auth0( @RequestParam("username")String username, @RequestParam("password")String password,
                         @RequestParam("targetAddress")String targetAddress){
        return authService.auth0(username,password,targetAddress);
    }

}
